Short documentation of the sceVif1* functions:		(Translated by psx_kai / Dok-Version 1.1)

In general those function cunstruct a list of DMATags to be send to GS using VIF and DMA.
Most of the complexity derives from advanced list management.

1. Data structure:

Root block of List at LISTROOTPTR:
	 0: WorkPtr
	 4: OrgPtr
	 8: OldWorkPtr
	12: LastPtr_OpenDirectCode
	16:
	20: LastPtr_OpenGifTag
	
Listentries starting at LISTBASEPTR:
  OpenDirectCode:
	 0: 0
	 4: 0
	 8: 0
	12: Value (Word)
  OpenGifTag:
   	 0: Value (Quad)
	 4: s.o.
	 8: s.o.
	12: s.o.
  GSData:
   	 0: LO 32 Bit
	 4: HI 32 Bit

2. Functions:

sceVif1PkInit:
	a0: LISTROOTPTR
	a1: LISTBASEPTR
	WorkPtr and OrgPtr will be set to the value of a1 (LISTBASEPTR).
        OldWorkPtr=0

sceVif1PkReset:
	a0: LISTROOTPTR
	WorkPtr will be set to the value of OrgPtr (LISTBASEPTR as defined in sceVif1PkInit).
        OldWorkPtr=0

sceVif1PkAlign:
	a0: LISTROOTPTR
	a1: number of bits to be masked from the right side (a1+2)
	a2: value to increment WorkPtr to (4*a2)
        WorkPtr is incremented to the next value ending on (4*a2). The skipped
        Bytes will be set to Zero.
        (e.g. a1=2 and a2=3 will mask 4 bits from right to "0" and increment WorkPtr
         to next number ending on 0x12)

sceVif1PkOpenDirectCode:
	a0: LISTROOTPTR
	a1: Select value
	WorkPtr incremented to next 0x12 (sceVif1PkAlign). Then the following Value
        is stored: a1=0 -> Value=0x5000
 	 	   a1=1 -> Value=0xD000
        LastPtr_OpenDirectCode=WorkPtr
        Result:
	  OpenDirectCode:
		 0: 0
		 4: 0
		 8: 0
		12: Value (Word)
     WorkPtr -> 16: 

sceVif1PkOpenGifTag:
	a0: LISTROOTPTR
	a1: Value (Quadword)
        Value is stored at Workptr (Quadword)
        LastPtr_OpenGifTag=WorkPtr
	Result:
	  OpenGifTag:
	   	 0: Value (Quadword)
		 4: s.o.
		 8: s.o.
		12: s.o.
     WorkPtr -> 16: 

sceVif1PkAddGSData:
	a0: LISTROOTPTR
	a1: Value
        LO 32 Bit of Value stored to Pos 0
        HI 32 Bit of Value stored to Pos 4
	Result:
	  GSData:
	   	 0: LO 32 Bit
		 4: HI 32 Bit
     WorkPtr ->  8: 

sceVif1PkCloseGifTag:
	a0: LISTROOTPTR
	Depending on LastPtr_OpenGifTag there are some changes made to the last GifTag.
        I dont't know what changes are made ...
	LastPtr_OpenGifTag is set to 0
        WorkPtr is incremented to the next value ending on 0x00. The skipped
        Bytes will be set to Zero.

sceVif1PkCloseDirectCode:
	a0: LISTROOTPTR
	Depending on LastPtr_OpenDirectCode there are some changes made to the last DirectCode.
        I dont't know what changes are made ...
	LastPtr_OpenDirectCode is set to 0

sceVif1PkTerminate:
        WorkPtr is incremented to the next value ending on 0x00. The skipped
        Bytes will be set to Zero.
	If OldWorkPtr<>0 then there are some changes made to OldWorkPtr - I dont't know
        what changes are made ...
	OldWorkPtr is set to 0
	The function returns the new WorkPtr

sceVif1PkEnd:
	a0: LISTROOTPTR
	a1: Value
        First Workptr will be incremented to the next value ending on 0x00 using
        sceVif1PkTerminate (eventually OldWrkPtr changes)
        Workptr is saved to OldWorkPtr
	The value 0x70000000 is written to the adress WorkPtr is pointing at.
	LastPtr_OpenDirectCode is set to 0

sceVif1PkCnt:
	a0: LISTROOTPTR
	a1: Value
        First Workptr will be incremented to the next value ending on 0x00 using
        sceVif1PkTerminate (eventually OldWrkPtr changes)
        Workptr is saved to OldWorkPtr
	The value 0x10000000 is written to the adress WorkPtr is pointing at.
	LastPtr_OpenDirectCode is set to 0

That's it for the translation. In addition I partially corrected the content.

BTW: If you know the original, I would like to get your opinion concerning the
     translation. I just don't have a feeling about the quality of my
     english. (Just evaluate on range of 0 (horrible) - 10 (god-like)). 
     :-))))

psx_kai - 04/2001
psx_kai@yahoo.de
